#define addline(line) 	(line = (line+1)%25) 
#define VIDEOMEM_BEGIN (unsigned char *) 0xb8000;
#define MAX_LINES 25
#define BLANK (unsigned char) ' '
#define WHITE_COLOR (unsigned char) 0x07
#define MAX_DOTS_PER_LINE 160
#define RIGHT_TO_LEFT 0
#define LEFT_TO_RIGHT 1
#define CRLF (unsigned char *) "\n"
#define EOL "\n\0"

void print(void *);
void print_result();
void cls();
void printc(unsigned char);
void htos(unsigned int, unsigned char *);
unsigned int ctoh(unsigned char);
unsigned char htoc(unsigned int);
unsigned int stoh( unsigned char *, int);
void scroll(void);
void line_clear(int);
void init_video(void);
int intlen(unsigned int);
int hexlen(unsigned int);

struct video_pos {
    int line;
    int dot;
};

extern struct video_pos *pos;
